#include <sdk.h>
#include <manager.h>
#include <editormanager.h>
#include "byogame.h"

GameLauncher::GamesT& GameLauncher::GetGames() {
  static GamesT m_Games;
  return m_Games;
}

GameLauncher::GameLauncher( const wxString& Name ): m_Name( Name ) {
  GetGames().Add( this );
}

GameLauncher::~GameLauncher() {
  GetGames().Remove( this );
}

BEGIN_EVENT_TABLE( byoEditorBase, EditorBase )
  EVT_SET_FOCUS( byoEditorBase::OnSetFocus )
END_EVENT_TABLE()

byoEditorBase::byoEditorBase( const wxString& GameName ):
  EditorBase( ( wxWindow* )Manager::Get()->GetEditorManager()->GetNotebook(), GameName ) {
}

byoEditorBase::~byoEditorBase() {
}

void byoEditorBase::AddGameContent( GameBase* base ) {
  wxSizer* Sizer = new wxBoxSizer( wxHORIZONTAL );
  m_Shortname = GetFilename();
  SetTitle( GetFilename() );
  m_Content = base;
  Sizer->Add( m_Content, 1, wxEXPAND );
  SetSizer( Sizer );
  Layout();
  m_Content->SetFocus();
}
